﻿using System;
using System.Collections.Generic;
using System.Text;

class Surface {
    protected int maxWeight;
    protected int width;
    protected List<Node> nodes;

    public Surface() {
        this.nodes = new List<Node>();
    }

    public int MaxWeight {
        set { this.maxWeight = value; }
    }

    public int Width {
        set { this.width = value; }
    }

    public void AddNode(String nodeString, double scaleX = 1, double scaleY = 1) {
        this.nodes.Add(this.parseNodeFromString(nodeString, scaleX, scaleY));
    }

    protected Node parseNodeFromString(String nodeString, double scaleX, double scaleY) {
        string[] strPoints = nodeString.Split(',');
        int[] points = new int[2];
        points[0] = (int) (Convert.ToInt32(strPoints[0]) * scaleX);
        points[1] = (int) (Convert.ToInt32(strPoints[1]) * scaleY);
        return new Node(points[0], points[1]);
    }
}
